﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using System.Globalization;

namespace Search
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        /// <summary>
        /// Redefinit la fonction d'initialisaion de la culture
        /// </summary>
        protected override void InitializeCulture()
        {
            if (Session["user-language"] != null)
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(Session["user-language"].ToString());
        }

        /// <summary>
        /// Redirige le client vers la page de résultats en passant les paramètres de
        /// la requete
        /// </summary>
        public void Dosearch(object sender, EventArgs e)
        {
            Response.Redirect(string.Concat("results.aspx?NeedPageIndex=0&TypeOfQuery=", typeofquery.Text, "&Query=", this.query.Text, "&MaxResponsePerPage=", this.responseperpage.Text, "&Language=french"), true);
        }
    }
}
